package entity

import "time"

type DockerInfo struct {
	ID         int       `gorm:"column:id" json:"id"`
	Name       string    `gorm:"column:name" json:"name"`
	IP         string    `gorm:"column:ip" json:"ip"`
	Port       string    `gorm:"column:port" json:"port"`
	CreateTime time.Time `gorm:"column:create_time;autoUpdateTime" json:"create_time"`
}

type ContainerInfo struct {
	ID            int     `gorm:"column:id"`
	DockerIp      string  `gorm:"column:docker_ip"`
	ContainerName string  `gorm:"column:container_name"` //容器名称
	ImageName     string  `gorm:"column:image_name"`     //镜像名称
	CpuUsage      float64 `gorm:"column:cpu_usage"`      //cpu使用率
	MemUsage      float64 `gorm:"column:mem_usage"`      //内存使用率
	State         string  `gorm:"column:state"`          //容器运行状态
	Status        string  `gorm:"column:status"`         //容器运行时长
	//RunningTime   int64     `gorm:"column:running_time"`   //容器运行时长,单位秒
	CreatedAt  time.Time `gorm:"column:created_at"` //容器创建时间
	StartedAt  time.Time `gorm:"column:started_at"` //容器创建时间
	Ports      string    `gorm:"column:ports"`      //端口映射
	Networks   string    `gorm:"column:networks"`   //网络信息
	Mounts     string    `gorm:"column:mounts"`     //挂载信息
	CreateTime time.Time `gorm:"column:create_time;autoUpdateTime"`
	UpdateTime time.Time `gorm:"column:update_time;autoUpdateTime"`
}
